Seizure Sensing and Detection Using an Implantable Device

ABSTRACT

A system and method for detecting and predicting neurological events with an implantable device uses a relatively low-power central processing unit in connection with signal processing circuitry to identify features (including half waves) and calculate window-based characteristics (including line lengths and areas under the curve of the waveform) in an electrographic signal received from a patient&#39;s brain. The features and window-based characteristics are combinable in various ways according to the invention to detect and predict neurological events in real time, enabling responsive action by the implantable device.

CROSS-REFERENCE TO RELATED APPLICATION

This is a divisional of U.S. Ser. No. 10/973,091, filed Oct. 25, 2004,which is a continuation of U.S. patent application Ser. No. 09/896,092,filed on Jun. 28, 2001 now U.S. Pat. No. 6,810,285. U.S. Ser. No.10/973,091 and U.S. Ser. No. 09/896,092 are hereby incorporated byreference in the entirety.

FIELD OF THE INVENTION

The invention relates to systems and methods for detecting andpredicting neurological dysfunction characterized by abnormalelectrographic patterns, and more particularly to a system and methodfor detecting and predicting epileptic seizures and their onsets byanalyzing electroencephalogram and electrocorticogram signals with animplantable device.

BACKGROUND OF THE INVENTION

Epilepsy, a neurological disorder characterized by the occurrence ofseizures (specifically episodic impairment or loss of consciousness,abnormal motor phenomena, psychic or sensory disturbances, or theperturbation of the autonomic nervous system), is debilitating to agreat number of people. It is believed that as many as two to fourmillion Americans may suffer from various forms of epilepsy. Researchhas found that its prevalence may be even greater worldwide,particularly in less economically developed nations, suggesting that theworldwide figure for epilepsy sufferers may be in excess of one hundredmillion.

Because epilepsy is characterized by seizures, its sufferers arefrequently limited in the kinds of activities they may participate in.Epilepsy can prevent people from driving, working, or otherwiseparticipating in much of what society has to offer. Some epilepsysufferers have serious seizures so frequently that they are effectivelyincapacitated.

Furthermore, epilepsy is often progressive and can be associated withdegenerative disorders and conditions. Over time, epileptic seizuresoften become more frequent and more serious, and in particularly severecases, are likely to lead to deterioration of other brain functions(including cognitive function) as well as physical impairments.

The current state of the art in treating neurological disorders,particularly epilepsy, typically involves drug therapy and surgery. Thefirst approach is usually drug therapy.

A number of drugs are approved and available for treating epilepsy, suchas sodium valproate, phenobarbital/primidone, ethosuximide, gabapentin,phenytoin, and carbamazepine, as well as a number of others.Unfortunately, those drugs typically have serious side effects,especially toxicity, and it is extremely important in most cases tomaintain a precise therapeutic serum level to avoid breakthroughseizures (if the dosage is too low) or toxic effects (if the dosage istoo high). The need for patient discipline is high, especially when apatient's drug regimen causes unpleasant side effects the patient maywish to avoid.

Moreover, while many patients respond well to drug therapy alone, asignificant number (at least 20-30%) do not. For those patients, surgeryis presently the best-established and most viable alternative course oftreatment.

Currently practiced surgical approaches include radical surgicalresection such as hemispherectomy, corticectomy, lobectomy and partiallobectomy, and less-radical lesionectomy, transection, and stereotacticablation. Besides being less than fully successful, these surgicalapproaches generally have a high risk of complications, and can oftenresult in damage to eloquent (i.e., functionally important) brainregions and the consequent long-term impairment of various cognitive andother neurological functions. Furthermore, for a variety of reasons,such surgical treatments are contraindicated in a substantial number ofpatients. And unfortunately, even after radical brain surgery, manyepilepsy patients are still not seizure-free.

Electrical stimulation is an emerging therapy for treating epilepsy.However, currently approved and available electrical stimulation devicesapply continuous electrical stimulation to neural tissue surrounding ornear implanted electrodes, and do not perform any detection—they are notresponsive to relevant neurological conditions.

The NeuroCybernetic Prosthesis (NCP) from Cyberonics, for example,applies continuous electrical stimulation to the patient's vagus nerve.This approach has been found to reduce seizures by about 50% in about50% of patients. Unfortunately, a much greater reduction in theincidence of seizures is needed to provide clinical benefit. The Activadevice from Medtronic is a pectorally implanted continuous deep brainstimulator intended primarily to treat Parkinson's disease. Inoperation, it supplies a continuous electrical pulse stream to aselected deep brain structure where an electrode has been implanted.

Continuous stimulation of deep brain structures for the treatment ofepilepsy has not met with consistent success. To be effective interminating seizures, it is believed that one effective site wherestimulation should be performed is near the focus of the epileptogenicregion. The focus is often in the neocortex, where continuousstimulation may cause significant neurological deficit with clinicalsymptoms including loss of speech, sensory disorders, or involuntarymotion. Accordingly, research has been directed toward automaticresponsive epilepsy treatment based on a detection of imminent seizure.

A typical epilepsy patient experiences episodic attacks or seizures,which are generally electrographically defined as periods of abnormalneurological activity. As is traditional in the art, such periods shallbe referred to herein as “ictal”.

Most prior work on the detection and responsive treatment of seizuresvia electrical stimulation has focused on analysis ofelectroencephalogram (EEG) and electrocorticogram (ECoG) waveforms. Ingeneral, EEG signals represent aggregate neuronal activity potentialsdetectable via electrodes applied to a patient's scalp. ECoG signals,deep-brain counterparts to EEG signals, are detectable via electrodesimplanted on or under the dura mater, and usually within the patient'sbrain. Unless the context clearly and expressly indicates otherwise, theterm “EEG” shall be used generically herein to refer to both EEG andECoG signals.

Much of the work on detection has focused on the use of time-domainanalysis of EEG signals. See, e.g., J. Gotman, Automatic seizuredetection: improvements and evaluation, Electroencephalogr. Clin.Neurophysiol. 1990; 76(4): 317-24. In a typical time-domain detectionsystem, EEG signals are received by one or more implanted electrodes andthen processed by a control module, which then is capable of performingan action (intervention, warning, recording, etc.) when an abnormalevent is detected.

It is generally preferable to be able to detect and treat a seizure ator near its beginning, or even before it begins. The beginning of aseizure is referred to herein as an “onset.” However, it is important tonote that there are two general varieties of seizure onsets. A “clinicalonset” represents the beginning of a seizure as manifested throughobservable clinical symptoms, such as involuntary muscle movements orneurophysiological effects such as lack of responsiveness. An“electrographic onset” refers to the beginning of detectableelectrographic activity indicative of a seizure. An electrographic onsetwill frequently occur before the corresponding clinical onset, enablingintervention before the patient suffers symptoms, but that is not alwaysthe case. In addition, there are changes in the EEG that occur secondsor even minutes before the electrographic onset that can be identifiedand used to facilitate intervention before electrographic or clinicalonsets occur. This capability would be considered seizure prediction, incontrast to the detection of a seizure or its onset.

In the Gotman system, EEG waveforms are filtered and decomposed into“features” representing characteristics of interest in the waveforms.One such feature is characterized by the regular occurrence (i.e.,density) of half-waves exceeding a threshold amplitude occurring in aspecified frequency band between approximately 3 Hz and 20 Hz,especially in comparison to background (non-ictal) activity. When suchhalf-waves are detected, it is believed that seizure activity isoccurring. For related approaches, see also H. Qu and J. Gotman, Aseizure warning system for long term epilepsy monitoring, Neurology1995; 45: 2250-4; and H. Qu and J. Gotman, A Patient-Specific Algorithmfor the Detection of Seizure Onset in Long-Term EEG Monitoring: PossibleUse as a Warning Device, IEEE Trans. Biomed. Eng. 1997; 44(2): 115-22.

The Gotman articles address half wave characteristics in general, andintroduce a variety of measurement criteria, including a ratio ofcurrent epoch amplitude to background; average current epoch EEGfrequency; average background EEG frequency; coefficient of variation ofwave duration; ratio of current epoch amplitude to following timeperiod; average wave amplitude; average wave duration; dominantfrequency (peak frequency of the dominant peak); and average power in amain energy zone. These criteria are variously mapped into ann-dimensional space, and whether a seizure is detected depends on thevector distance between the parameters of a measured segment of EEG anda seizure template in that space.

It should be noted that the schemes set forth in the above articles arenot tailored for use in an implantable device, and hence typicallyrequire more computational ability than would be available in such adevice.

U.S. Pat. No. 6,018,682 to Rise describes an implantable seizure warningsystem that implements a form of the Gotman system. However, the systemdescribed therein uses only a single detection modality, namely a countof sharp spike and wave patterns within a timer period. This isaccomplished with relatively complex processing, including averagingover time and quantifying sharpness by way of a second derivative of thesignal. The Rise patent does not disclose how the signals are processedat a low level, nor does it explain detection criteria in anysufficiently specific level of detail.

A more computationally demanding approach is to transform EEG signalsinto the frequency domain for rigorous spectrum analysis. See, e.g.,U.S. Pat. No. 5,995,868 to Dorfmeister et al., which analyzes the powerspectral density of EEG signals in comparison to backgroundcharacteristics. Although this approach is generally believed to achievegood results, for the most part, its computational expense renders itless than optimal for use in long-term implanted epilepsy monitor andtreatment devices. With current technology, the battery life in animplantable device computationally capable of performing the Dorfmeistermethod would be too short for it to be feasible.

Also representing an alternative and more complex approach is U.S. Pat.No. 5,857,978 to Hively et al., in which various non-linear andstatistical characteristics of EEG signals are analyzed to identify theonset of ictal activity. Once more, the calculation of statisticallyrelevant characteristics is not believed to be feasible in animplantable device.

U.S. Pat. No. 6,016,449 to Fischell, et al. (which is herebyincorporated by reference as though set forth in full herein), describesan implantable seizure detection and treatment system. In the Fischellsystem, various detection methods are possible, all of which essentiallyrely upon the analysis (either in the time domain or the frequencydomain) of processed EEG signals. Fischell's controller is preferablyimplanted intracranially, but other approaches are also possible,including the use of an external controller. When a seizure is detected,the Fischell system applies responsive electrical stimulation toterminate the seizure, a capability that will be discussed in furtherdetail below.

All of these approaches provide useful information, and in some casesmay provide sufficient information for accurate detection and predictionof most imminent epileptic seizures.

However, none of the various implementations of the known approachesprovide 100% seizure detection accuracy in a clinical environment.

Two types of detection errors are generally possible. A “falsepositive,” as the term is used herein, refers to a detection of aseizure or ictal activity when no seizure or other abnormal event isactually occurring. Similarly, a “false negative” herein refers to thefailure to detect a seizure or ictal activity that actually is occurringor shortly will occur.

In most cases, with all known implementations of the known approaches todetecting abnormal seizure activity solely by monitoring and analyzingEEG activity, when a seizure detection algorithm is tuned to catch allseizures, there will be a significant number of false positives. Whileit is currently believed that there are minimal or no side effects tolimited amounts of over-stimulation (e.g., providing stimulationsufficient to terminate a seizure in response to a false positive), thepossibility of accidentally initiating a seizure or increasing thepatient's susceptibility to seizures must be considered.

As is well known, it has been suggested that it is possible to treat andterminate seizures by applying electrical stimulation to the brain. See,e.g., U.S. Pat. No. 6,016,449 to Fischell et al., and H. R. Wagner, etal., Suppression of cortical epileptiform activity by generalized andlocalized ECoG desynchronization, Electroencephalogr. Clin.Neurophysiol. 1975; 39(5): 499-506. And as stated above, it is believedto be beneficial to perform this stimulation only when a seizure (orother undesired neurological event) is occurring or about to occur, asinappropriate stimulation may result in the initiation of seizures.

Furthermore, it should be noted that a false negative (that is, aseizure that occurs without any warning or treatment from the device)will often cause the patient significant discomfort and detriment.Clearly, false negatives are to be avoided.

It has been found to be difficult to achieve an acceptably low level offalse positives and false negatives with the level of computationalability available in an implantable device with reasonable battery life.

Preferably, the battery in an implantable device, particularly oneimplanted intracranially, should last at least several years. There is asubstantial risk of complications (such as infection, blood clots, andthe overgrowth of scar tissue) and lead failure each time an implanteddevice or its battery is replaced. Rechargeable batteries have not beenfound to provide any advantage in this regard, as they are not asefficient as traditional cells, and the additional electronic circuitryrequired to support the recharging operation contributes to the device'ssize and complexity. Moreover, there is a need for patient discipline inrecharging the device batteries, which would require the frequenttransmission of a substantial amount of power over a wireless link andthrough the patient's skin and other tissue.

As stated above, the detection and prediction of ictal activity hastraditionally required a significant amount of computational ability.Moreover, for an implanted device to have significant real-worldutility, it is also advantageous to include a number of other featuresand capabilities. Specifically, treatment (via electrical stimulation ordrug infusion) and/or warning (via an audio annunciator, for example),recording of EEG signals for later consideration and analysis, andtelemetry providing a link to external equipment are all usefulcapabilities for an implanted device capable of detecting or predictingepileptiform signals. All of these additional subsystems will consumefurther power.

Moreover, size is also a consideration. For various reasons,intracranial implants are favored. A device implanted intracranially (orunder the scalp) will typically have a lower risk of failure than asimilar device implanted pectorally or elsewhere, which require a leadto be run from the device, through the patient's neck to the electrodeimplantation sites in the patient's head. This lead is also prone toreceive additional electromagnetic interference.

As is well known in the art, the computational ability of aprocessor-controlled system is directly related to both size and powerconsumption. In accordance with the above considerations, therefore, itwould be advantageous to have sufficient detection and predictioncapabilities to avoid a substantial number of false positive and falsenegative detections, and yet consume little enough power (in conjunctionwith the other subsystems) to enable long battery life. Such animplantable device would have a relatively low-power central processingunit to reduce the electrical power consumed by that portion.

At the current time, there is no known implantable device that iscapable of detecting and predicting seizures and yet has adequatebattery life and the consequent acceptably low risk factors for use inhuman patients.

SUMMARY OF THE INVENTION

Accordingly, an implantable device according to the invention fordetecting and predicting epileptic seizures includes a relativelylow-speed and low-power central processing unit, as well as customizedelectronic circuit modules in a detection subsystem. As describedherein, the detection subsystem also performs prediction, which in thecontext of the present application is a form of detection that occursbefore identifiable clinical symptoms or even obvious electrographicpatterns are evident upon inspection. The same methods, potentially withdifferent parameters, are adapted to be used for both detection andprediction. Generally, as described herein, an event (such as anepileptic seizure) may be detected, an electrographic “onset” of such anevent (an electrographic indication of an event occurring at the sametime as or before the clinical event begins) may be detected (and may becharacterized by different waveform observations than the event itself),and a “precursor” to an event (electrographic activity regularlyoccurring some time before the clinical event) may be detected aspredictive of the event.

As described herein and as the terms are generally understood, thepresent approach is generally not statistical or stochastic in nature.The invention, and particularly the detection subsystem thereof, isspecifically adapted to perform much of the signal processing andanalysis requisite for accurate and effective event detection. Thecentral processing unit remains in a suspended “sleep” statecharacterized by relative inactivity a substantial percentage of thetime, and is periodically awakened by interrupts from the detectionsubsystem to perform certain tasks related to the detection andprediction schemes enabled by the device.

Much of the processing performed by an implantable system according tothe invention involves operations on digital data in the time domain.Preferably, to reduce the amount of data processing required by theinvention, samples at ten-bit resolution are taken at a rate less thanor equal to approximately 500 Hz (2 ms per sample).

As stated above, an implantable system according to the invention iscapable of accurate and reliable seizure detection and prediction. Toaccomplish this, the invention employs a combination of signalprocessing and analysis modalities, including data reduction and featureextraction techniques, mostly implemented as customized digitalelectronics modules, minimally reliant upon a central processing unit.

In particular, it has been found to be advantageous to utilize twodifferent data reduction methodologies, both of which collect datarepresentative of EEG signals within a sequence of uniform time windowseach having a specified duration.

The first data reduction methodology involves the calculation of a “linelength function” for an EEG signal within a time window. Specifically,the line length function of a digital signal represents an accumulationof the sample-to-sample amplitude variation in the EEG signal within thetime window. Stated another way, the line length function isrepresentative of the variability of the input signal. A constant inputsignal will have a line length of zero (representative of substantiallyno variation in the signal amplitude), while an input signal thatoscillates between extrema from sample to sample will approach themaximum line length. It should be noted that while the line lengthfunction has a physical-world analogue in measuring the vector distancetraveled in a graph of the input signal, the concept of line length astreated herein disregards the horizontal (X) axis in such a situation.The horizontal axis herein is representative of time, which is notcombinable in any meaningful way in accordance with the invention withinformation relating to the vertical (Y) axis, generally representativeof amplitude, and which in any event would contribute nothing ofinterest.

The second data reduction methodology involves the calculation of an“area function” represented by an EEG signal within a time window.Specifically, the area function is calculated as an aggregation of theEEG's signal total deviation from zero over the time window, whetherpositive or negative. The mathematical analogue for the area functiondefined above is the mathematical integral of the absolute value of theEEG function (as both positive and negative signals contribute topositive area). Once again, the horizontal axis (time) makes nocontribution to accumulated energy as treated herein. Accordingly, aninput signal that remains around zero will have a small area value,while an input signal that remains around the most-positive ormost-negative values will have a high area value.

Both the area and line length functions may undergo linear or non-lineartransformations. An example would be to square each amplitude beforesumming it in the area function. This non-linear operation would providean output that would approximate the energy of the signal for the periodof time it was integrated. Likewise linear and non-lineartransformations of the difference between sample values are advantageousin customizing the line length function to increase the effectiveness ofthe detector for a specific patient.

The central processing unit receives the line length function and areafunction measurements performed by the detection subsystem, and iscapable of acting based on those measurements or their trends.

Feature extraction, specifically the identification of half waves in anEEG signal, also provides useful information. A half wave is an intervalbetween a local waveform minimum and a local waveform maximum; each timea signal “changes directions” (from increasing to decreasing, or viceversa), subject to limitations that will be set forth in further detailbelow, a new half wave is identified.

The identification of half waves having specific amplitude and durationcriteria allows some frequency-driven characteristics of the EEG signalto be considered and analyzed without the need for computationallyintensive transformations of normally time-domain EEG signals into thefrequency domain. Specifically, the half wave feature extractioncapability of the invention identifies those half waves in the inputsignal having a duration that exceeds a minimum duration criterion andan amplitude that exceeds a minimum amplitude criterion. The number ofhalf waves in a time window meeting those criteria is somewhatrepresentative of the amount of energy in a waveform at a frequencybelow the frequency corresponding to the minimum duration criterion. Andthe number of half waves in a time window is constrained somewhat by theduration of each half wave (i.e., if the half waves in a time windowhave particularly long durations, relatively fewer of them will fit intothe time window), that number is highest when a dominant waveformfrequency most closely matches the frequency corresponding to theminimum duration criterion.

As stated above, the half waves, line length function, and area functionof various EEG signals are calculated by customized electronics moduleswith minimal involvement by the central processing unit, and areselectively combined by a system according to the invention to providedetection and prediction of seizure activity, so that appropriate actioncan then be taken.

Accordingly, in one embodiment of the invention, a system according tothe invention includes a central processing unit, a detection subsystemlocated therein that includes a waveform analyzer. The waveform analyzerincludes waveform feature analysis capabilities (such as half wavecharacteristics) as well as window-based analysis capabilities (such asline length and area under the curve), and both aspects are combined toprovide enhanced neurological event detection. A central processing unitis used to consolidate the results from multiple channels and coordinateresponsive action when necessary.

BRIEF DESCRIPTION OF THE DRAWINGS

These and other objects, features, and advantages of the invention willbecome apparent from the detailed description below and the accompanyingdrawings, in which:

FIG. 1 is a schematic illustration of a patient's head showing theplacement of an implantable neurostimulator according to an embodimentof the invention;

FIG. 2 is a schematic illustration of a patient's cranium showing theimplantable neurostimulator of FIG. 1 as implanted, including leadsextending to the patient's brain;

FIG. 3 is a block diagram illustrating context in which an implantableneurostimulator according to the invention is implanted and operated;

FIG. 4 is a block diagram illustrating the major functional subsystemsof an implantable neurostimulator according to the invention;

FIG. 5 is a block diagram illustrating the functional components of thedetection subsystem of the implantable neurostimulator shown in FIG. 4;

FIG. 6 is a block diagram illustrating the functional components of thesensing front end of the detection subsystem of FIG. 5;

FIG. 7 is a block diagram illustrating the components of the waveformanalyzer of the detection subsystem of FIG. 5;

FIG. 8 is a block diagram illustrating the functional arrangement ofcomponents of the waveform analysis of the detection subsystem of FIG. 5in one possible programmed embodiment of the invention;

FIG. 9 is a graph of an exemplary EEG signal, illustrating decompositionof the signal into time windows and samples;

FIG. 10 is a graph of the exemplary EEG signal of FIG. 9, illustratingthe extraction of half waves from the signal;

FIG. 11 is a flow chart illustrating the process performed by hardwarefunctional components of the waveform analyzer of FIG. 7 in extractinghalf waves as illustrated in FIG. 10;

FIG. 12 is a flow chart illustrating the process performed by softwarein the central processing unit in extracting and analyzing half wavesfrom an EEG signal;

FIG. 13 is a flow chart illustrating the process performed by softwarein the central processing unit in the application of an X of Y criterionto half wave windows;

FIG. 14 is a graph of the exemplary EEG signal of FIG. 9, illustratingthe calculation of a line length function;

FIG. 15 is a flow chart illustrating the process performed by hardwarefunctional components of the waveform analyzer of FIG. 7 in calculatingthe line length function as illustrated in FIG. 14;

FIG. 16 is a flow chart illustrating the process performed by softwarein the central processing unit in calculating and analyzing the linelength function of an EEG signal;

FIG. 17 is a graph of the exemplary EEG signal of FIG. 9, illustratingthe calculation of an area function;

FIG. 18 is a flow chart illustrating the process performed by hardwarefunctional components of the waveform analyzer of FIG. 7 in calculatingthe area function as illustrated in FIG. 17;

FIG. 19 is a flow chart illustrating the process performed by softwarein the central processing unit in calculating and analyzing the areafunction of an EEG signal;

FIG. 20 is a flow chart illustrating the process performed byevent-driven software in the central processing unit to analyze halfwave, line length, and area information for detection according to theinvention;

FIG. 21 is a flow chart illustrating the combination of analysis toolsinto detection channels in an embodiment of the invention; and

FIG. 22 is a flow chart illustrating the combination of detectionchannels into event detectors in an embodiment of the invention.

DETAILED DESCRIPTION OF THE INVENTION

The invention is described below, with reference to detailedillustrative embodiments. It will be apparent that a system according tothe invention may be embodied in a wide variety of forms. Consequently,the specific structural and functional details disclosed herein arerepresentative and do not limit the scope of the invention.

FIG. 1 depicts an intracranially implanted device 110 according to theinvention, which in one embodiment is a small self-contained responsiveneurostimulator. As the term is used herein, a responsiveneurostimulator is a device capable of detecting or predicting ictalactivity (or other neurological events) and providing electricalstimulation to neural tissue in response to that activity, where theelectrical stimulation is specifically intended to terminate the ictalactivity, treat a neurological event, prevent an unwanted neurologicalevent from occurring, or lessen the severity or frequency of certainsymptoms of a neurological disorder. As disclosed herein, the responsiveneurostimulator detects ictal activity by systems and methods accordingto the invention.

Preferably, an implantable device according to the invention is capableof detecting or predicting any kind of neurological event that has arepresentative electrographic signature. While the disclosed embodimentis described primarily as responsive to epileptic seizures, it should berecognized that it is also possible to respond to other types ofneurological disorders, such as movement disorders (e.g. the tremorscharacterizing Parkinson's disease), migraine headaches, chronic pain,and neuropsychiatric disorders such as depression. Preferably,neurological events representing any or all of these afflictions can bedetected when they are actually occurring, in an onset stage, or as apredictive precursor before clinical symptoms begin.

In the disclosed embodiment, the neurostimulator is implantedintracranially in a patient's parietal bone 210, in a location anteriorto the lambdoidal suture 212 (see FIG. 2). It should be noted, however,that the placement described and illustrated herein is merely exemplary,and other locations and configurations are also possible, in the craniumor elsewhere, depending on the size and shape of the device andindividual patient needs, among other factors. The device 110 ispreferably configured to fit the contours of the patient's cranium 214.In an alternative embodiment, the device 110 is implanted under thepatient's scalp 112 but external to the cranium; it is expected,however, that this configuration would generally cause an undesirableprotrusion in the patient's scalp where the device is located. In yetanother alternative embodiment, when it is not possible to implant thedevice intracranially, it may be implanted pectorally (not shown), withleads extending through the patient's neck and between the patient'scranium and scalp, as necessary.

It should be recognized that the embodiment of the device 110 describedand illustrated herein is preferably a responsive neurostimulator fordetecting and treating epilepsy by detecting seizures or their onsets orprecursors, and preventing and/or terminating such epileptic seizures.

In an alternative embodiment of the invention, the device 110 is not aresponsive neurostimulator, but is an apparatus capable of detectingneurological conditions and events and performing actions in responsethereto. The actions performed by such an embodiment of the device 110need not be therapeutic, but may involve data recording or transmission,providing warnings to the patient, or any of a number of knownalternative actions. Such a device will typically act as a diagnosticdevice when interfaced with external equipment, as will be discussed infurther detail below.

The device 110, as implanted intracranially, is illustrated in greaterdetail in FIG. 2. The device 110 is affixed in the patient's cranium 214by way of a ferrule 216. The ferrule 216 is a structural member adaptedto fit into a cranial opening, attach to the cranium 214, and retain thedevice 110.

To implant the device 110, a craniotomy is performed in the parietalbone anterior to the lambdoidal suture 212 to define an opening 218slightly larger than the device 110. The ferrule 216 is inserted intothe opening 218 and affixed to the cranium 214, ensuring a tight andsecure fit. The device 110 is then inserted into and affixed to theferrule 216.

As shown in FIG. 2, the device 110 includes a lead connector 220 adaptedto receive one or more electrical leads, such as a first lead 222. Thelead connector 220 acts to physically secure the lead 222 to the device110, and facilitates electrical connection between a conductor in thelead 222 coupling an electrode to circuitry within the device 110. Thelead connector 220 accomplishes this in a substantially fluid-tightenvironment with biocompatible materials.

The lead 222, as illustrated, and other leads for use in a system ormethod according to the invention, is a flexible elongated member havingone or more conductors. As shown, the lead 222 is coupled to the device110 via the lead connector 220, and is generally situated on the outersurface of the cranium 214 (and under the patient's scalp 112),extending between the device 110 and a burr hole 224 or other cranialopening, where the lead 222 enters the cranium 214 and is coupled to adepth electrode (see FIG. 4) implanted in a desired location in thepatient's brain. If the length of the lead 222 is substantially greaterthan the distance between the device 110 and the burr hole 224, anyexcess may be urged into a coil configuration under the scalp 112. Asdescribed in U.S. Pat. No. 6,006,124 to Fischell, et al., which ishereby incorporated by reference as though set forth in full herein, theburr hole 224 is sealed after implantation to prevent further movementof the lead 222; in an embodiment of the invention, a burr hole coverapparatus is affixed to the cranium 214 at least partially within theburr hole 224 to provide this functionality.

The device 110 includes a durable outer housing 226 fabricated from abiocompatible material. Titanium, which is light, extremely strong, andbiocompatible, is used in analogous devices, such as cardiac pacemakers,and would serve advantageously in this context. As the device 110 isself-contained, the housing 226 encloses a battery and any electroniccircuitry necessary or desirable to provide the functionality describedherein, as well as any other features. As will be described in furtherdetail below, a telemetry coil may be provided outside of the housing226 (and potentially integrated with the lead connector 220) tofacilitate communication between the device 110 and external devices.

The neurostimulator configuration described herein and illustrated inFIG. 2 provides several advantages over alternative designs. First, theself-contained nature of the neurostimulator substantially decreases theneed for access to the device 110, allowing the patient to participatein normal life activities. Its small size and intracranial placementcauses a minimum of cosmetic disfigurement. The device 110 will fit inan opening in the patient's cranium, under the patient's scalp, withlittle noticeable protrusion or bulge. The ferrule 216 used forimplantation allows the craniotomy to be performed and fit verifiedwithout the possibility of breaking the device 110, and also providesprotection against the device 110 being pushed into the brain underexternal pressure or impact. A further advantage is that the ferrule 216receives any cranial bone growth, so at explant, the device 110 can bereplaced without removing any bone screws—only the fasteners retainingthe device 110 in the ferrule 216 need be manipulated.

As stated above, and as illustrated in FIG. 3, a neurostimulatoraccording to the invention operates in conjunction with externalequipment. The device 110 is mostly autonomous (particularly whenperforming its usual sensing, detection, and stimulation capabilities),but preferably includes a selectable part-time wireless link 310 toexternal equipment such as a programmer 312. In the disclosed embodimentof the invention, the wireless link 310 is established by moving a wand(or other apparatus) having communication capabilities and coupled tothe programmer 312 into range of the device 110. The programmer 312 canthen be used to manually control the operation of the device 110, aswell as to transmit information to or receive information from thedevice 110. Several specific capabilities and operations performed bythe programmer 312 in conjunction with the device 110 will be describedin further detail below.

The programmer 312 is capable of performing a number of advantageousoperations in connection with the invention. In particular, theprogrammer 312 is able to specify and set variable parameters in thedevice 110 to adapt the function of the device 110 to meet the patient'sneeds, download or receive data (including but not limited to stored EEGwaveforms, parameters, or logs of actions taken) from the device 110 tothe programmer 312, upload or transmit program code and otherinformation from the programmer 312 to the device 110, or command thedevice 110 to perform specific actions or change modes as desired by aphysician operating the programmer 312. To facilitate these functions,the programmer 312 is adapted to receive physician input 314 and providephysician output 316; data is transmitted between the programmer 312 andthe device 110 over the wireless link 310.

The programmer 312 may be coupled via a communication link 318 to anetwork 320 such as the Internet. This allows any information downloadedfrom the device 110, as well as any program code or other information tobe uploaded to the device 110, to be stored in a database at one or moredata repository locations (which may include various servers andnetwork-connected programmers like the programmer 312). This would allowa patient (and the patient's physician) to have access to importantdata, including past treatment information and software updates,essentially anywhere in the world that there is a programmer (like theprogrammer 312) and a network connection.

An overall block diagram of the device 110 used for measurement,detection, and treatment according to the invention is illustrated inFIG. 4. Inside the housing 226 of the device 110 are several subsystemsmaking up a control module 410. The control module 410 is capable ofbeing coupled to a plurality of electrodes 412, 414, 416, and 418 (eachof which may be connected to the control module 410 via a lead that isanalogous or identical to the lead 222 of FIG. 2) for sensing andstimulation. In the illustrated embodiment, the coupling is accomplishedthrough the lead connector 220 (FIG. 2). Although four electrodes areshown in FIG. 4, it should be recognized that any number is possible,and in the embodiment described in detail below, eight electrodes areused. In fact, it is possible to employ an embodiment of the inventionthat uses a single lead with at least two electrodes, or two leads eachwith a single electrode (or with a second electrode provided by aconductive exterior portion of the housing 226 in one embodiment),although bipolar sensing between two closely spaced electrodes on a leadis preferred to minimize common mode signals including noise.

The electrodes 412-418 are connected to an electrode interface 420.Preferably, the electrode interface is capable of selecting eachelectrode as required for sensing and stimulation; accordingly theelectrode interface is coupled to a detection subsystem 422 and astimulation subsystem 424. The electrode interface also may provide anyother features, capabilities, or aspects, including but not limited toamplification, isolation, and charge-balancing functions, that arerequired for a proper interface with neurological tissue and notprovided by any other subsystem of the device 110.

The detection subsystem 422 includes an EEG analyzer function. The EEGanalyzer function is adapted to receive EEG signals from the electrodes412-418, through the electrode interface 420, and to process those EEGsignals to identify neurological activity indicative of a seizure, anonset of a seizure, or a precursor to a seizure. One way to implementsuch EEG analysis functionality is disclosed in detail in U.S. Pat. No.6,016,449 to Fischell et al., incorporated by reference above;additional inventive methods are described in detail below. Thedetection subsystem may optionally also contain further sensing anddetection capabilities, including but not limited to parameters derivedfrom other physiological conditions (such as electrophysiologicalparameters, temperature, blood pressure, etc.).

The stimulation subsystem 424 is capable of applying electricalstimulation to neurological tissue through the electrodes 412-418. Thiscan be accomplished in any of a number of different manners. Forexample, it may be advantageous in some circumstances to providestimulation in the form of a substantially continuous stream of pulses,or on a scheduled basis. Preferably, therapeutic stimulation is providedin response to abnormal events detected by the EEG analyzer function ofthe detection subsystem 422. As illustrated in FIG. 4, the stimulationsubsystem 424 and the EEG analyzer function of the detection subsystem422 are in communication; this facilitates the ability of stimulationsubsystem 424 to provide responsive stimulation as well as an ability ofthe detection subsystem 422 to blank the amplifiers while stimulation isbeing performed to minimize stimulation artifacts. It is contemplatedthat the parameters of the stimulation signal (e.g., frequency,duration, waveform) provided by the stimulation subsystem 424 would bespecified by other subsystems in the control module 410, as will bedescribed in further detail below.

Also in the control module 410 is a memory subsystem 426 and a centralprocessing unit (CPU) 428, which can take the form of a microcontroller.The memory subsystem is coupled to the detection subsystem 422 (e.g.,for receiving and storing data representative of sensed EEG signals andevoked responses), the stimulation subsystem 424 (e.g., for providingstimulation waveform parameters to the stimulation subsystem), and theCPU 428, which can control the operation of the memory subsystem 426. Inaddition to the memory subsystem 426, the CPU 428 is also connected tothe detection subsystem 422 and the stimulation subsystem 424 for directcontrol of those subsystems.

Also provided in the control module 410, and coupled to the memorysubsystem 426 and the CPU 428, is a communication subsystem 430. Thecommunication subsystem 430 enables communication between the device 110(FIG. 1) and the outside world, particularly the external programmer 312(FIG. 3). As set forth above, the disclosed embodiment of thecommunication subsystem 430 includes a telemetry coil (which may besituated outside of the housing 226) enabling transmission and receptionof signals, to or from an external apparatus, via inductive coupling.Alternative embodiments of the communication subsystem 430 could use anantenna for an RF link or an audio transducer for an audio link.

Rounding out the subsystems in the control module 410 are a power supply432 and a clock supply 434. The power supply 432 supplies the voltagesand currents necessary for each of the other subsystems. The clocksupply 434 supplies substantially all of the other subsystems with anyclock and timing signals necessary for their operation.

It should be observed that while the memory subsystem 426 is illustratedin FIG. 4 as a separate functional subsystem, the other subsystems mayalso require various amounts of memory to perform the functionsdescribed above and others. Furthermore, while the control module 410 ispreferably a single physical unit contained within a single physicalenclosure, namely the housing 226 (FIG. 2), it may comprise a pluralityof spatially separate units each performing a subset of the capabilitiesdescribed above. Also, it should be noted that the various functions andcapabilities of the subsystems described above may be performed byelectronic hardware, computer software (or firmware), or a combinationthereof. The division of work between the CPU 428 and the otherfunctional subsystems may also vary—the functional distinctionsillustrated in FIG. 4 may not reflect the integration of functions in areal-world system or method according to the invention.

FIG. 5 illustrates details of the detection subsystem 422 (FIG. 4).Inputs from the electrodes 412-418 are on the left, and connections toother subsystems are on the right.

Signals received from the electrodes 412-418 (as routed through theelectrode interface 420) are received in an electrode selector 510. Theelectrode selector 510 allows the device to select which electrodes (ofthe electrodes 412-418) should be routed to which individual sensingchannels of the detection subsystem 422, based on commands receivedthrough a control interface 518 from the memory subsystem 426 or the CPU428 (FIG. 4). Preferably, each sensing channel of the detectionsubsystem 422 receives a bipolar signal representative of the differencein electrical potential between two selectable electrodes. Accordingly,the electrode selector 510 provides signals corresponding to each pairof selected electrodes (of the electrodes 412-418) to a sensing frontend 512, which performs amplification, analog to digital conversion, andmultiplexing functions on the signals in the sensing channels. Thesensing front end will be described further below in connection withFIG. 6.

A multiplexed input signal representative of all active sensing channelsis then fed from the sensing front end 512 to a waveform analyzer 514.The waveform analyzer 514 is preferably a special-purpose digital signalprocessor (DSP) adapted for use with the invention, or in an alternativeembodiment, may comprise a programmable general-purpose DSP. In thedisclosed embodiment, the waveform analyzer has its own scratchpadmemory area 516 used for local storage of data and program variableswhen the signal processing is being performed. In either case, thesignal processor performs suitable measurement and detection methodsdescribed generally above and in greater detail below. Any results fromsuch methods, as well as any digitized signals intended for storagetransmission to external equipment, are passed to various othersubsystems of the control module 410, including the memory subsystem 426and the CPU 428 (FIG. 4) through a data interface 520. Similarly, thecontrol interface 518 allows the waveform analyzer 514 and the electrodeselector 510 to be in communication with the CPU 428.

Referring now to FIG. 6, the sensing front end 512 (FIG. 5) isillustrated in further detail. As shown, the sensing front end includesa plurality of differential amplifier channels 610, each of whichreceives a selected pair of inputs from the electrode selector 510. In apreferred embodiment of the invention, each of differential amplifierchannels 610 is adapted to receive or to share inputs with one or moreother differential amplifier channels 610 without adversely affectingthe sensing and detection capabilities of a system according to theinvention. Specifically, in an embodiment of the invention, there are atleast eight electrodes, which can be mapped separately to eightdifferential amplifier channels 610 representing eight different sensingchannels and capable of individually processing eight bipolar signals,each of which represents an electrical potential difference between twomonopolar input signals received from the electrodes and applied to thesensing channels via the electrode selector 510. For clarity, only fivechannels are illustrated in FIG. 6, but it should be noted that anypractical number of sensing channels may be employed in a systemaccording to the invention.

Each differential amplifier channel 610 feeds a corresponding analog todigital converter (ADC) 612. Preferably, the analog to digitalconverters 612 are separately programmable with respect to samplerates—in the disclosed embodiment, the ADCs 612 convert analog signalsinto 10-bit unsigned integer digital data streams at a sample rateselectable between 250 Hz and 500 Hz. In several of the illustrationsdescribed below where waveforms are shown, sample rates of 250 Hz aretypically used for simplicity. However, the invention shall not bedeemed to be so limited, and numerous sample rate and resolution optionsare possible, with tradeoffs known to individuals of ordinary skill inthe art of electronic signal processing. The resulting digital signalsare received by a multiplexer 614 that creates a single interleaveddigital data stream representative of the data from all active sensingchannels. As will be described in further detail below, not all of thesensing channels need to be used at one time, and it may in fact beadvantageous in certain circumstances to deactivate certain sensingchannels to reduce the power consumed by a system according to theinvention.

It should be noted that as illustrated and described herein, a “sensingchannel” is not necessarily a single physical or functional item thatcan be identified in any illustration. Rather, a sensing channel isformed from the functional sequence of operations described herein, andparticularly represents a single electrical signal received from anypair or combination of electrodes, as preprocessed by a system accordingto the invention, in both analog and digital forms. See, e.g., U.S.patent application Ser. No. 09/517,797 to D. Fischell et al., filed onMar. 2, 2000 and entitled “Neurological Event Detection Using ProcessedDisplay Channel Based Algorithms and Devices Incorporating TheseProcedures,” which is hereby incorporated by reference as though setforth in full herein. At times (particularly after the multiplexer 614),multiple sensing channels are processed by the same physical andfunctional components of the system; notwithstanding that, it should berecognized that unless the description herein indicates to the contrary,a system according to the invention processes, handles, and treats eachsensing channel independently.

The interleaved digital data stream is passed from the multiplexer 614,out of the sensing front end 512, and into the waveform analyzer 514.The waveform analyzer 514 is illustrated in detail in FIG. 7.

The interleaved digital data stream representing information from all ofthe active sensing channels is first received by a channel controller710. The channel controller applies information from the active sensingchannels to a number of wave morphology analysis units 712 and windowanalysis units 714. It is preferred to have as many wave morphologyanalysis units 712 and window analysis units 714 as possible, consistentwith the goals of efficiency, size, and low power consumption necessaryfor an implantable device. In a presently preferred embodiment of theinvention, there are sixteen wave morphology analysis units 712 andeight window analysis units 714, each of which can receive data from anyof the sensing channels of the sensing front end 512, and each of whichcan be operated with different and independent parameters, includingdiffering sample rates, as will be discussed in further detail below.

Each of the wave morphology analysis units 712 operates to extractcertain feature information from an input waveform as described below inconjunction with FIGS. 9-11. Similarly, each of the window analysisunits 714 performs certain data reduction and signal analysis withintime windows in the manner described in conjunction with FIGS. 12-17.Output data from the various wave morphology analysis units 712 andwindow analysis units 714 are combined via event detector logic 716. Theevent detector logic 716 and the channel controller 710 are controlledby control commands 718 received from the control interface 518 (FIG.5).

A “detection channel,” as the term is used herein, refers to a datastream including the active sensing front end 512 and the analysis unitsof the waveform analyzer 514 processing that data stream, in both analogand digital forms. It should be noted that each detection channel canreceive data from a single sensing channel; each sensing channelpreferably can be applied to the input of any combination of detectionchannels. The latter selection is accomplished by the channel controller710. As with the sensing channels, not all detection channels need to beactive; certain detection channels can be deactivated to save power orif additional detection processing is deemed unnecessary in certainapplications.

In conjunction with the operation of the wave morphology analysis units712 and the window analysis units 714, a scratchpad memory area 516 isprovided for temporary storage of processed data. The scratchpad memoryarea 516 may be physically part of the memory subsystem 426, oralternatively may be provided for the exclusive use of the waveformanalyzer 514. Other subsystems and components of a system according tothe invention may also be furnished with local scratchpad memory, ifsuch a configuration is advantageous.

The operation of the event detector logic 716 is illustrated in detailin the functional block diagram of FIG. 8, in which four exemplarysensing channels are analyzed by three illustrative event detectors.

A first sensing channel 810 provides input to a first event detector812. While the first event detector 812 is illustrated as a functionalblock in the block diagram of FIG. 8, it should be recognized that it isa functional block only for purposes of illustration, and may not haveany physical counterpart in a device according to the invention.Similarly, a second sensing channel 814 provides input to a second eventdetector 816, and a third input channel 818 and a fourth input channel820 both provide input to a third event detector 822.

Considering the processing performed by the event detectors 812, 816,and 822, the first input channel 810 feeds a signal to both a wavemorphology analysis unit 824 (one of the wave morphology analysis units712 of FIG. 7) and a window analysis unit 826 (one of the windowanalysis units 714 of FIG. 7). The window analysis unit 826, in turn,includes a line length analysis tool 828 and an area analysis tool 830.As will be discussed in detail below, the line length analysis tool 828and the area analysis tool 830 analyze different aspects of the signalfrom the first input channel 810

Outputs from the wave morphology analysis unit 824, the line lengthanalysis tool 828, and the area analysis tool 830 are combined in aBoolean AND operation 832 and sent to an output 834 for further use by asystem according to the invention. For example, if a combination ofanalysis tools in an event detector identifies several simultaneous (ornear-simultaneous) types of activity in an input channel, a systemaccording to the invention may be programmed to perform an action inresponse thereto. Details of the analysis tools and the combinationprocesses used in event detectors according to the invention will be setforth in greater detail below.

In the second event detector 816, only a wave morphology analysis unit836 is active. Accordingly, no Boolean operation needs to be performed,and the wave morphology analysis unit 836 directly feeds an eventdetector output 838.

The third event detector 822 operates on two input channels 818 and 820,and includes two separate detection channels of analysis units: a firstwave morphology analysis unit 840 and a first window analysis unit 842,the latter including a first line length analysis tool 844 and a firstarea analysis tool 846; and a second wave morphology analysis unit 848and a second window analysis unit 850, the latter including a secondline length analysis tool 852 and a second area analysis tool 854. Thetwo detection channels of analysis units are combined to provide asingle event detector output 856.

In the first detection channel of analysis units 840 and 842, outputsfrom the first wave morphology analysis unit 840, the first line lengthanalysis tool 844, and the first area analysis tool 846 are combined viaa Boolean AND operation 858 into a first detection channel output 860.Similarly, in the second detection channel of analysis units 848 and850, outputs from the second wave morphology analysis unit 848, thesecond line length analysis tool 852, and the second area analysis tool854 are combined via a Boolean AND operation 862 into a second detectionchannel output 864. In the illustrated embodiment of the invention, thesecond detection channel output 864 is invertible with selectableBoolean logic inversion 866 before it is combined with the firstdetection channel output 860. Subsequently, the first detection channeloutput 860 and the second detection channel output 864 are combined witha Boolean AND operation 868 to provide a signal to the output 856. In analternative embodiment, a Boolean OR operation is used to combine thefirst detection channel output 860 and the second detection channeloutput 864.

In one embodiment of the invention, the second detection channel(analysis units 848 and 850) represents a “qualifying channel” withrespect to the first detection channel (analysis units 840 and 842). Ingeneral, a qualifying channel allows a detection to be made only whenboth channels are in concurrence with regard to detection of an event.For example, a qualifying channel can be used to indicate when a seizurehas “generalized,” i.e. spread through a significant portion of apatient's brain. To do this, the third input channel 818 and the fourthinput channel 820 are configured to receive EEG waveforms from separateamplifier channels coupled to electrodes in separate parts of thepatient's brain (e.g., in opposite hemispheres). Accordingly, then, theBoolean AND operation 868 will indicate a detection only when the firstdetection output 860 and the second detection output 864 both indicatethe presence of an event (or, when Boolean logic inversion 866 ispresent, when the first detection output 860 indicates the presence ofan event while the second detection output 864 does not). As will bedescribed in further detail below, the detection outputs 860 and 864 canbe provided with selectable persistence (i.e., the ability to remaintriggered for some time after the event is detected), allowing theBoolean AND combination 868 to be satisfied even when there is notprecise temporal synchronization between detections on the two channels.

It should be appreciated that the concept of a “qualifying channel”allows the flexible configuration of a device 110 according to theinvention to achieve a number of advantageous results. In addition tothe detection of generalization, as described above, a qualifyingchannel can be configured, for example, to detect noise so a detectionoutput is valid only when noise is not present, to assist in deviceconfiguration in determining which of two sets of detection parametersis preferable (by setting up the different parameters in the firstdetection channel and the second detection channel, then replacing theBoolean AND combination with a Boolean OR combination), or to require aspecific temporal sequence of detections (which would be achieved insoftware by the CPU 428 after a Boolean OR combination of detections).There are numerous other possibilities.

The outputs 834, 838, and 856 of the event detectors are preferablyrepresented by Boolean flags, and as described below, provideinformation for the operation of a system according to the invention.

While FIG. 8 illustrates four different sensing channels providing inputto four separate detection channels, it should be noted that a maximallyflexible embodiment of the present invention would allow each sensingchannel to be connected to one or more detection channels. It may beadvantageous to program the different detection channels with differentsettings (e.g., thresholds) to facilitate alternate “views” of the samesensing channel data stream.

FIG. 9 illustrates three representative waveforms of the type expectedto be manipulated by a system according to the invention. It should benoted, however, that the waveforms illustrated in FIG. 9 areillustrative only, and are not intended to represent any actual data.The first waveform 910 is representative of an unprocessedelectroencephalogram (EEG) or electrocorticogram (ECoG) waveform havinga substantial amount of variability; the illustrated segment has aduration of approximately 160 ms and a dominant frequency (visible asthe large-scale crests and valleys) of approximately 12.5 Hz. It will berecognized that the first waveform is rather rough and peaky; there is asubstantial amount of high-frequency energy represented therein.

The second waveform 912 represents a filtered version of the originalEEG waveform 910. As shown, most of the high-frequency energy has beeneliminated from the signal, and the waveform 912 is significantlysmoother. In the disclosed embodiment of the invention, this filteringoperation is performed in the sensing front end 512 before the analog todigital converters 612 (FIG. 6).

The filtered waveform 912 is then sampled by one of the analog todigital converters 612; this operation is represented graphically in thethird waveform 914 of FIG. 9. As illustrated, a sample rate used in anembodiment of the invention is 250 Hz (4 ms sample duration), resultingin approximately 40 samples over the illustrated 160 ms segment. As iswell known in the art of digital signal processing, the amplituderesolution of each sample is limited; in the disclosed embodiment, eachsample is measured with a resolution of 10 bits (or 1024 possiblevalues). As is apparent upon visual analysis of the third waveform, thedominant frequency component has a wavelength of approximately 20samples, which corresponds to the dominant frequency of 12.5 Hz.

Referring now to FIG. 10, the processing of the wave morphology analysisunits 712 is described in conjunction with a filtered and sampledwaveform 1010 of the type illustrated as the third waveform 914 of FIG.9.

In a first half wave 1012, which is partially illustrated in FIG. 10(the starting point occurs before the illustrated waveform segment 1010begins), the waveform segment 1010 is essentially monotonicallydecreasing, except for a small first perturbation 1014. Accordingly, thefirst half wave 1012 is represented by a vector from the starting point(not shown) to a first local extremum 1016, where the waveform starts tomove in the opposite direction. The first perturbation 1014 is ofinsufficient amplitude to be considered a local extremum, and isdisregarded by a hysteresis mechanism (discussed in further detailbelow). A second half wave 1018 extends between the first local extremum1016 and a second local extremum 1020. Again, a second perturbation 1022is of insufficient amplitude to be considered an extremum. Likewise, athird half wave 1024 extends between the second local extremum 1020 anda third local extremum 1026; this may appear to be a small perturbation,but is greater in amplitude than a selected hysteresis threshold. Theremaining half waves 1028, 1030, 1032, 1034, and 1036 are identifiedanalogously. As will be discussed in further detail below, each of theidentified half waves 1012, 1018, 1024, 1028, 1030, 1032, 1034, and 1036has a corresponding duration 1038, 1040, 1042, 1044, 1046, 1048, 1050,and 1052, respectively, and analogously, a corresponding amplitudedetermined from the relative positions of each half wave's startingpoint and ending point along the vertical axis, and a slope direction,increasing or decreasing.

In a method performed according to the invention, it is particularlyadvantageous to allow for a programmable hysteresis setting inidentifying the ends of half waves. In other words, as explained above,the end of an increasing or decreasing half wave might be prematurelyidentified as a result of quantization (and other) noise, low-amplitudesignal components, and other perturbing factors, unless a smallhysteresis allowance is made before a reversal of waveform direction(and a corresponding half wave end) is identified. Hysteresis allows forinsignificant variations in signal level inconsistent with the signal'soverall movement to be ignored without the need for extensive furthersignal processing such as filtering. Without hysteresis, such small andinsignificant variations might lead to substantial and gross changes inwhere half waves are identified, leading to unpredictable results.

The processing steps performed with regard to the waveform 1010 and halfwaves of FIG. 10 are set forth in FIG. 11. The method begins byidentifying an increasing half wave (with an ending amplitude higherthan the starting amplitude, as in the second half wave 1018 of FIG.10). To do this, a variable corresponding to half wave time is firstinitialized to zero (step 1110); then half wave duration, endingthreshold, peak amplitude, and first sample value are all initialized(step 1112). Specifically, the half wave duration value is set to zero;the peak amplitude and first sample values are set to the amplitudevalue of the last observed sample, which as described above is a valuehaving 10-bit precision; and the ending threshold is set to the lastobserved sample minus a small preset hysteresis value. After waiting fora measurement of the current EEG sample (step 1114), the half wave timeand half wave duration variables are incremented (step 1116). If thecurrent EEG sample has an amplitude greater than the peak amplitude(step 1118), then the amplitude of the half wave is increasing (orcontinues to increase). Accordingly, the ending threshold is reset to bethe current EEG sample's amplitude minus the hysteresis value, and thepeak is reset to the current EEG sample's amplitude (step 1120), and thenext sample is awaited (step 1114).

If the current EEG sample has an amplitude less than the endingthreshold (step 1122), then the hysteresis value has been exceeded, anda local extremum has been identified. Accordingly, the end of theincreasing half wave has been reached, and the amplitude and duration ofthe half wave are calculated (step 1124). The amplitude is equal to thepeak amplitude minus the first sample value; the duration is equal tothe current half wave duration. Otherwise, the next ample is awaited(step 1114).

If both the amplitude and the duration qualify by exceedingcorresponding preset thresholds (step 1126), then the amplitude,duration, half wave time, half wave direction (increasing) are stored ina buffer (step 1128), and the half wave time is reset to zero (step1130).

At the conclusion of the increasing half wave, the process continues byinitializing wave duration, the ending threshold, the peak amplitude,and the first sample value (step 1132). Wave duration is set to zero,the ending threshold is set to the last sample value plus the hysteresisvalue, the peak amplitude and the first sample value are set to the mostrecent sample value.

After waiting for a measurement of the current EEG sample (step 1134),the half wave time and half wave duration variables are incremented(step 1136). If the current EEG sample has an amplitude lower than thepeak amplitude (step 1138), then the amplitude of the half wave isdecreasing (or continues to decrease). Accordingly, the ending thresholdis reset to be the current EEG sample's amplitude plus the hysteresisvalue, the peak is reset to the current EEG sample's amplitude (step1140), and the next sample is awaited (step 1134).

If the current EEG sample has an amplitude greater than the endingthreshold (step 1142), then the hysteresis value has been exceeded, anda local extremum has been identified. Accordingly, the end of thedecreasing half wave has been reached, and the amplitude and duration ofthe half wave are calculated (step 1144). The amplitude is equal to thefirst sample value minus the peak amplitude, and the duration is equalto the current half wave duration. Otherwise, the next EEG sample isawaited (step 1134).

If both the amplitude and the duration qualify by exceedingcorresponding preset thresholds (step 1146), then the amplitude,duration, half wave time, half wave direction (decreasing) are stored ina buffer (step 1148), and the half wave time is reset to zero (step1150). It should be noted that, in the context of this specification,the term “exceed” in regard to a threshold value means to meet aspecified criterion. Generally, to exceed a threshold herein is to havea numeric value greater than or equal to the threshold, although otherinterpretations (such as greater than, or less than, or less than orequal to, depending on the context) may be applicable and are deemed tobe within the scope of the invention.

At the conclusion of the decreasing half wave, further half waves arethen identified by repeating the process from step 1112. As half wavedetection is an ongoing and continuous process, this procedurepreferably does not exit, but may be suspended from time to time whenconditions or device state call for it, e.g. when the device is inactiveor when stimulation is being performed. Once suspended in accordancewith the invention, the procedure should recommence with the firstinitialization step 1110.

Accordingly, the process depicted in FIG. 11 stores parameterscorresponding to qualified half waves, including their directions,durations, amplitudes, and the elapsed time between adjacent qualifiedhalf waves (i.e. the half wave time variable). In the disclosedembodiment of the invention, to reduce power consumption, this procedureis performed in custom electronic hardware; it should be clear that theoperations of FIG. 11 are performed in parallel for each active instanceof the wave morphology analysis units 712 (FIG. 7). It should also benoted, however, that certain software can also be used to advantageouseffect in this context.

This stored information is used in the software process illustrated inFIG. 12, which is performed on a periodic basis, preferably once everyprocessing window (a recurring time interval that is either fixed orprogrammable) by a system according to the invention. Consistent withthe other analysis tools described herein, the duration of an exemplaryprocessing window is in one embodiment of the invention 128 ms, whichcorresponds to 32 samples at a 250 Hz sampling rate.

Each time the software process of FIG. 12 is invoked, the half wavewindow flag is first cleared (step 1210). Any qualified half wavesidentified by the process set forth in FIG. 11 that are newly identifiedsince the last invocation of the procedure (i.e., all qualified halfwaves that ended within the preceding processing window) are identified(step 1212). A “current half wave” pointer is set to point to the oldestqualified half wave identified in the most recent processing window(step 1214). The time interval between the current half wave and theprior x half waves is then measured (step 1216), where x is a specifiedminimum number of half waves (preferably a programmable value) to beidentified within a selected half wave time window (the duration ofwhich is another programmable value) to result in the possible detectionof a neurological event. If the time interval is less than the durationof the half wave time window (step 1218), then the half wave window flagis set (step 1220), logic inversion is selectively applied (step 1222),and the procedure ends (step 1224). Logic inversion, a mechanism fordetermining whether an analysis unit is triggered by the presence orabsence of a condition, is explained in greater detail below. Otherwise,the current half wave pointer is incremented to point to the next newhalf wave (step 1228), and if there are no more new half waves (step1230), logic inversion is applied if desired (step 1222), and theprocedure ends (step 1224). Otherwise, the next time interval is tested(step 1216) and the process continues from there.

Logic inversion allows the output flag for the wave morphology analysisunit (or any other analyzer) to be selectively inverted. If logicinversion is configured to be applied to an output of a particularanalysis unit, then the corresponding flag will be clear when thedetection criterion (e.g., number of qualified half waves) is met, andset when the detection criterion is not met. This capability providessome additional flexibility in configuration, facilitating detection ofthe absence of certain signal characteristics when, for example, thepresence of those characteristics is the norm.

In a preferred embodiment of the invention, the half wave window flag(set in step 1220) indicates whether a sufficient number of qualifiedhalf waves occur over an interval ending in the most recent processingwindow. To reduce the occurrence of spurious detections, an X of Ycriterion is applied, causing the wave morphology analysis unit totrigger only if a sufficient number of qualified half waves occur in Xof the Y most recent processing windows, where X and Y are parametersindividually adjustable for each analysis tool. This process isillustrated in FIG. 13.

Initially, a sum (representing recent processing windows having the halfwave window flag set) is cleared to zero and a current window pointer isinitialized to point to the most recent processing window (step 1310).If the half wave window flag corresponding to the current window pointeris set (step 1312), then the sum is incremented (step 1314). If thereare more processing windows to examine (for an X of Y criterion, a totalof Y processing windows, including the most recent, should beconsidered) (step 1316), then the window pointer is decremented (step1318) and the flag testing and sum incrementing steps (steps 1312-1314)are repeated.

After Y windows have been considered, if the sum of windows having sethalf wave window flags meets the threshold X (step 1320), then the halfwave analysis flag is set (step 1322), persistence (described below) isapplied (step 1324), and the procedure is complete. Otherwise, the halfwave analysis flag is cleared (step 1326).

Persistence, another per-analysis-tool setting, allows the effect of anevent detection (a flag set) to persist beyond the end of the detectionwindow in which the event occurs. In the disclosed system according tothe invention, persistence may be set anywhere from one second tofifteen seconds (though other settings are possible), so if detectionswith multiple analysis tools do not all occur simultaneously (thoughthey should still occur within a fairly short time period), a Booleancombination of flags will still yield positive results. Persistence canalso be used with a single analysis tool to smooth the results.

When the process of FIG. 13 is completed, the half wave analysis flag(set or cleared in steps 1322 and 1326, respectively) indicates whetheran event has been detected in the corresponding channel of the wavemorphology analysis units 712, or stated another way, whether asufficient number of qualified half waves have appeared in X of the Ymost recent processing windows. Although in the disclosed embodiment,the steps of FIGS. 12 and 13 are performed in software, it should berecognized that some or all of those steps can be performed using customelectronics, if it proves advantageous in the desired application to usesuch a configuration.

FIG. 14 illustrates the waveform of FIG. 9, further depicting linelengths identified within a time window. The time window used withrespect to FIGS. 14-16 may be different from the half wave processingwindow described above in connection with FIGS. 12-13, but in apreferred embodiment, refers to the same time intervals. From animplementation standpoint, a single device interrupt upon the conclusionof each processing window allows all of the analysis tools to performthe necessary corresponding software processes; the line length analysisprocess of FIG. 16 (described below) is one such example. A waveform1410 is a filtered and otherwise pre-processed EEG signal as received inone of the window analysis units 714 from the sensing front end 512. Asdiscussed above, line lengths are considered within time windows. Asillustrated in FIG. 14, the duration of an exemplary window 1412 is 32samples, which is equivalent to 128 ms at a 250 Hz sampling rate.

The total line length for the window 1412 is the sum of thesample-to-sample amplitude differences within that window 1412. Forexample, the first contribution to the line length within the window1412 is a first amplitude difference 1414 between a previous sample 1416occurring immediately before the window 1412 and a first sample 1418occurring within the window 1412. The next contribution comes from asecond amplitude difference 1420 between the first sample 1418 and asecond sample 1422; a further contribution 1424 comes from a thirdamplitude difference between the second sample 1422 and a third sample1426; and so on. At the end of the window 1412, the final contributionto the line length comes from a last amplitude difference 1430 between asecond-last sample 1432 in the window 1412 and a last sample 1434 in thewindow 1412. Note that all line lengths, whether increasing ordecreasing in direction, are accumulated as positive values by theinvention; accordingly, a decreasing amplitude difference 1414 and anincreasing amplitude difference 1428 both contribute to a greater linelength.

As illustrated herein, and as discussed in detail above, there arethirty-two samples within the window 1412. The illustrated window 1412has a duration of 128 ms, and accordingly, the illustrated sample rateis 250 Hz. It should be noted, however, that alternate window durationsand sample rates are possible and considered to be within the scope ofthe present invention.

The line lengths illustrated in FIG. 14 are calculated as shown by theflow chart of FIG. 15, which is invoked at the beginning of a timewindow. Initially, a line length total variable is initialized to zero(step 1510). The current sample is awaited (step 1512), and the absolutevalue of the amplitude difference between the current sample and theprevious sample (which, when considering the first sample in a window,may come from the last sample in a previous window) is measured (step1514).

In various alternative embodiments of the invention, either the measureddifference (as calculated in step 1514, described above), or the samplevalues used to calculate the difference may be mathematicallytransformed in useful nonlinear ways. For example, it may beadvantageous in certain circumstances to calculate the differencebetween adjacent samples using the squares of the sample values, or tocalculate the square of the difference between sample values, or both.It is contemplated that other transformations (such as square root,exponentiation, logarithm, and other nonlinear functions) might also beadvantageous in certain circumstances. Whether or not to perform such atransformation and the nature of any transformation to be performed arepreferably programmable parameters of the device 110.

For use in the next iteration, the previous sample is replaced with thevalue of the current sample (step 1516), and the calculated absolutevalue is added to the total (step 1518). If there are more samplesremaining in the window 1412 (step 1520), another current sample isawaited (step 1512) and the process continues. Otherwise, the linelength calculation for the window 1412 is complete, and the total isstored (step 1522), the total is re-initialized to zero (step 1510), andthe process continues.

As with the half wave analysis method set forth above, the line lengthcalculation does not need to terminate; it can be free-running yetinterruptible. If the line length calculation is restarted after havingbeen suspended, it should be re-initialized and restarted at thebeginning of a window. This synchronization can be accomplished throughhardware interrupts.

The line lengths calculated as shown in FIG. 15 are then processed asindicated in the flow chart of FIG. 16, which is performed after eachwindow 1412 is calculated and stored (step 1522).

The process begins by calculating a running accumulated line lengthtotal over a period of n time windows. Where n>1, the effect is that ofa sliding window; in an alternative embodiment an actual sliding windowprocessing methodology may be used. First, the accumulated total isinitialized to zero (step 1610). A current window pointer is set toindicate the n^(th)-last window, i.e., the window (n−1) windows beforethe most recent window (step 1612). The line length of the currentwindow is added to the total (step 1614), the current window pointer isincremented (step 1616), and if there are more windows between thecurrent window pointer and the most recent (last) window (step 1618),the adding and incrementing steps (1614-1616) are repeated. Accordingly,by this process, the resulting total includes the line lengths for eachof the n most recent windows.

In the disclosed embodiment of the invention, the accumulated total linelength is compared to a dynamic threshold, which is based on a trend ofrecently observed line lengths. The trend is recalculated regularly andperiodically, after each recurring line length trend interval (which ispreferably a fixed or programmed time interval). Each time the linelength trend interval passes (step 1620), the line length trend iscalculated or updated (step 1622). In a presently preferred embodimentof the invention, this is accomplished by calculating a normalizedmoving average of several trend samples, each of which representsseveral consecutive windows of line lengths. A new trend sample is takenand the moving average is recalculated upon every line length trendinterval. The number of trend samples used in the normalized movingaverage and the number of consecutive windows of line lengthmeasurements per trend sample are preferably both fixed or programmablevalues.

After the line length trend has been calculated, the line lengththreshold is calculated (step 1624) based on the new line length trend.In the disclosed embodiment of the invention, the threshold may be setas either a percentage of the line length trend (either below 100% for athreshold that is lower than the trend, or above 100% for a thresholdthat is higher than the trend) or alternatively a fixed numeric offsetfrom the line length trend (either negative for a threshold that islower than the trend, or positive for a threshold that is higher thanthe trend). It should be observed that other methods for deriving anumeric threshold from a numeric trend are possible and deemed to bewithin the scope of the invention.

The first time the process of FIG. 16 is performed, there is generallyno line length trend against which to set a threshold. Accordingly, forthe first several passes through the process (until a sufficient amountof EEG data has been processed to establish a trend), the threshold isessentially undefined and the line length detector should not return apositive detection. Some “settling time” is required to establish trendsand thresholds before a detection can be made.

If the accumulated line length total exceeds the calculated threshold(step 1626), then a flag is set (step 1628) indicating aline-length-based event detection on the current window analysis unitchannel 714. As described above, in the disclosed embodiment of theinvention, the threshold is dynamically calculated from a line lengthtrend, but alternatively, the threshold may be static, either fixed orprogrammed into the device 110. If the accumulated line length totaldoes not exceed the threshold, the flag is cleared (step 1630). Once theline length flag has been either set or cleared, logic inversion isapplied (step 1632), persistence is applied (step 1634), and theprocedure terminates.

The resulting persistent line length flag indicates whether thethreshold has been exceeded within one or more windows over a timeperiod corresponding to the line length flag persistence. As will bediscussed in further detail below, line length event detections can becombined with the half wave event detections, as well as any otherapplicable detection criteria according to the invention.

FIG. 17 illustrates the waveform of FIG. 9 with area under the curveidentified within a window. Area under the curve, which in somecircumstances is somewhat representative of a signal's energy (thoughenergy of a waveform is more accurately represented by the area underthe square of a waveform), is another detection criterion in accordancewith the invention.

The total area under the curve represented by a waveform 1710 within thewindow 1712 is equal to the sum of the absolute values of the areas ofeach rectangular region of unit width vertically bounded by thehorizontal axis and the sample. For example, the first contribution tothe area under the curve within the window 1712 comes from a firstregion 1714 between a first sample 1716 and a baseline 1717. A secondcontribution to the area under the curve within the window 1712 comesfrom a second region 1718, including areas between a second sample 1720and the baseline 1717. There are similar regions and contributions for athird sample 1722 and the baseline 1717, a fourth sample 1724 and thebaseline 1717, and so on. It should be observed that the region widthsare not important—the area under each sample can be considered theproduct of the sample's amplitude and a unit width, which can bedisregarded. In a similar manner, each region is accumulated and addedto the total area under the curve within the window 1712. Although theconcept of separate rectangular regions is a useful construct forvisualizing the idea of area under a curve, it should be noted that aprocess for calculating area need not partition areas into regions asshown in FIG. 17—it is only necessary to accumulate the absolute valueof the waveform's amplitude at each sample, as the unit width of eachregion can be disregarded. The process for doing this will be set forthin detail below in connection with FIG. 18.

The areas under the curve illustrated in FIG. 17 are calculated as shownby the flow chart of FIG. 18, which is invoked at the beginning of atime window. Initially, an area total variable is initialized to zero(step 1810). The current sample is awaited (step 1812), and the absolutevalue of the current sample is measured (step 1814).

As with the line length calculation method described above (withreference to FIG. 15), in various alternative embodiments of theinvention, the current sample (as measured in step 1814, describedabove) may be mathematically transformed in useful nonlinear ways. Forexample, it may be advantageous in certain circumstances to calculatethe square of the current sample rather than its absolute value. Theresult of such a transformation by squaring each sample will generallybe more representative of signal energy, though it is contemplated thatother transformations (such as square root, exponentiation, logarithm,and other nonlinear functions) might also be advantageous in certaincircumstances. Whether or not to perform such a transformation and thenature of any transformation to be performed are preferably programmableparameters of the device 110.

The calculated absolute value is added to the total (step 1816). Ifthere are more samples remaining in the window 1712 (step 1818), anothercurrent sample is awaited (step 1812) and the process continues.Otherwise, the area calculation for the window 1712 is complete, and thetotal is stored (step 1820), the total is re-initialized to zero (step1810), and the process continues.

As with the half wave and line length analysis methods set forth above,the area calculation does not need to terminate; it can be free-runningyet interruptible. If the area calculation is restarted after havingbeen suspended, it should be re-initialized and restarted at thebeginning of a window. This synchronization can be accomplished throughhardware interrupts.

The line lengths calculated as shown in FIG. 18 are then processed asindicated in the flow chart of FIG. 19, which is performed after eachwindow 1712 is calculated and stored (step 1820).

The process begins by calculating a running accumulated area total overa period of n time windows. Where n>1, the effect is that of a slidingwindow; in an alternative embodiment an actual sliding window processingmethodology may be used. First, the accumulated total is initialized tozero (step 1910). A current window pointer is set to indicate then^(th)-last window, i.e., the window (n−1) windows before the mostrecent window (step 1912). The area for the current window is added tothe total (step 1914), the current window pointer is incremented (step1916), and if there are more windows between the current window and themost recent (last) window (step 1918), the adding and incrementing steps(1914-1916) are repeated. Accordingly, by this process, the resultingtotal includes the areas under the curve for each of the n most recentwindows.

In the disclosed embodiment of the invention, the accumulated total areais compared to a dynamic threshold, which is based on a trend ofrecently observed areas. The trend is recalculated regularly andperiodically, after each recurring area trend interval (which ispreferably a fixed or programmed time interval). Each time the areatrend interval passes (step 1920), the area trend is calculated orupdated (step 1922). In a presently preferred embodiment of theinvention, this is accomplished by calculating a normalized movingaverage of several trend samples, each of which represents severalconsecutive windows of areas. A new trend sample is taken and the movingaverage is recalculated upon every area trend interval. The number oftrend samples used in the normalized moving average and the number ofconsecutive windows of area measurements per trend sample are preferablyboth fixed or programmable values.

After the area trend has been calculated, the area threshold iscalculated (step 1924) based on the new area trend. As with line length,discussed above, the threshold may be set as either a percentage of thearea trend (either below 100% for a threshold that is lower than thetrend, or above 100% for a threshold that is higher than the trend) oralternatively a fixed numeric offset from the area trend (eithernegative for a threshold that is lower than the trend, or positive for athreshold that is higher than the trend).

The first time the process of FIG. 19 is performed, there is generallyno area trend against which to set a threshold. Accordingly, for thefirst several passes through the process (until a sufficient amount ofEEG data has been processed to establish a trend), the threshold isessentially undefined and the area detector should not return a positivedetection. Some “settling time” is required to establish trends andthresholds before a detection can be made.

If the accumulated total exceeds the calculated threshold (step 1926),then a flag is set (step 1928) indicating an area-based event detectionon the current window analysis unit channel 714. Otherwise, the flag iscleared (step 1930). Once the area flag has been either set or cleared,logic inversion is applied (step 1932), persistence is applied (step1934), and the procedure terminates.

The resulting persistent area flag indicates whether the threshold hasbeen exceeded within one or more windows over a time periodcorresponding to the area flag persistence. As will be discussed infurther detail below, area event detections can be combined with thehalf wave event detections, line length event detections, as well as anyother applicable detection criteria according to the invention.

In a preferred embodiment of the invention, each threshold for eachchannel and each analysis tool can be programmed separately;accordingly, a large number of individual thresholds may be used in asystem according to the invention. It should be noted thresholds canvary widely; they can be updated by a physician via the externalprogrammer 312 (FIG. 3), and some analysis tool thresholds (e.g., linelength and area) can also be automatically varied depending on observedtrends in the data. This is preferably accomplished based on a movingaverage of a specified number of window observations of line length orarea, adjusted as desired via a fixed offset or percentage offset, andmay compensate to some extent for diurnal and other normal variations inbrain electrophysiological parameters.

With regard to the flow charts of FIGS. 11-13, 15-16, and 18-19, itshould be noted that there can be a variety of ways these processes areimplemented. For example, state machines, software, hardware (includingASICs, FPGAs, and other custom electronics), and various combinations ofsoftware and hardware, are all solutions that would be possible topractitioners of ordinary skill in the art of electronics and systemsdesign. It should further be noted that the steps performed in softwareneed not be, as some of them can be implemented in hardware, if desired,to further reduce computational load on the processor. In the context ofthe invention, it is not believed to be advantageous to have thesoftware perform additional steps, as that would likely increase powerconsumption.

In an embodiment of the invention, one of the detection schemes setforth above (e.g., half wave detection) is adapted to use an X of Ycriterion to weed out spurious detections. This can be implemented via ashift register, as usual, or by more efficient computational methods. Asdescribed above, half waves are analyzed on a window-by-window basis,and as described above (in connection with FIG. 13), the window resultsare updated on a separate analysis window interval. If the detectioncriterion (i.e., a certain number of half waves in less than a specifiedtime period) is met for any of the half waves occurring in the mostrecent window, then detection is satisfied within that window. If thatoccurs for at least X of the Y most recent windows, then the half waveanalysis tool triggers a detection. If desired, other detectionalgorithms (such as line length and area) may operate in much the sameway: if thresholds are exceeded in at least X of the Y most recentwindows, then the corresponding analysis tool triggers a detection.

Also, in the disclosed embodiment, each detection flag, after being set,remains set for a selected amount of time, allowing them to be combinedby Boolean logic (as described below) without necessarily beingsimultaneous.

As indicated above, each of the software processes set forth above(FIGS. 12-13, 16, and 19) correspond to functions performed by the wavemorphology analysis units 712 and window analysis units 714. Each one isinitiated periodically, typically once per detection window (1212,1512). The outputs from the half wave and window analysis units 712 and714, namely the flags generated in response to counted qualified halfwaves, accumulated line lengths, and accumulated areas are combined toidentify event detections as functionally illustrated in FIG. 8 and asdescribed via flow chart in FIG. 20.

The process begins with the receipt of a timer interrupt (step 2010),which is typically generated on a regular periodic basis to indicate theedges of successive time windows. Accordingly, in a system or methodaccording to the disclosed embodiment of the invention, such a timerinterrupt is received every 128 ms, or as otherwise programmed ordesigned. Then the half wave (step 2012, FIGS. 12-13), line length (step2014, FIG. 16), and area (step 2016, FIG. 19) analysis tools areevaluated with respect to the latest data generated thereby, via thehalf wave analysis flag, the line length flag, and the area flag foreach active channel. The steps of checking the analysis tools (steps2012, 2014, and 2016) can be performed in any desired order or inparallel, as they are generally not interdependent. It should be notedthat the foregoing analysis tools should be checked for every activechannel, and may be skipped for inactive detection channels.

Flags, indicating whether particular signal characteristics have beenidentified in each active channel, for each active analysis tools, arethen combined into detection channels (step 2018) as illustrated in FIG.8. In the disclosed embodiment of the invention, this operation isperformed as described in detail below with reference to FIG. 21. Eachdetection channel is a Boolean AND combination of analysis tool flagsfor a single channel, and as disclosed above, there are preferably atleast eight channels in a system according to the invention.

The flags for multiple detection channels are then combined into eventdetector flags (step 2020), which are indicative of identifiedneurological events calling for action by the device. This process isdescribed below, see FIG. 20, and is in general a Boolean combination ofdetection channels, if there is more than one channel per eventdetector.

If an event detector flag is set (step 2022), then a correspondingaction is initiated (step 2024) by the device. Actions according to theinvention can include the presentation of a warning to the patient, anapplication of therapeutic electrical stimulation, a delivery of a doseof a drug, an initiation of a device mode change, or a recording ofcertain EEG signals; it will be appreciated that there are numerousother possibilities. It is preferred, but not necessary, for actionsinitiated by a device according to the invention to be performed inparallel with the sensing and detection operations described in detailherein. It should be recognized that the application of electricalstimulation to the brain may require suspension of certain of thesensing and detection operations, as electrical stimulation signals mayotherwise feed back into the detection system 422 (FIG. 4), causingundesirable results and signal artifacts.

Multiple event detector flags are possible, each one representing adifferent combination of detection channel flags. If there are furtherevent detector flags to consider (step 2026), those event detector flagsare also evaluated (step 2022) and may cause further actions by thedevice (step 2024). It should be noted that, in general, actionsperformed by the device (as in step 2024) may be in part dependent on adevice state—even if certain combinations of events do occur, no actionmay be taken if the device is in an inactive state, for example.

As described above, and as illustrated in FIG. 20 as step 2018, acorresponding set of analysis tool flags is combined into a detectionchannel flag as shown in FIG. 21 (see also FIG. 8). Initially the outputdetection channel flag is set (step 2110). Beginning with the firstanalysis tool for a particular detection channel (step 2112), if thecorresponding analysis tool flag is not set (step 2114), then the outputdetection channel flag is cleared (step 2116).

If the corresponding analysis tool flag is set (step 2114), the outputdetection channel flag remains set, and further analysis tools for thesame channel, if any (step 2118), are evaluated. Accordingly, thiscombination procedure operates as a Boolean AND operation—if any of theenabled and active analysis tools for a particular detection channeldoes not have a set output flag, then no detection channel flag isoutput by the procedure.

A clear analysis tool flag indicates that no detection has been madewithin the flag persistence period, and for those analysis tools thatemploy an X of Y criterion, that such criterion has not been met. Incertain circumstances, it may be advantageous to also provide detectionchannel flags with logic inversion. Where a desired criterion (i.e.,combination of analysis tools) is not met, the output flag is set(rather than cleared, which is the default action). This can beaccomplished by providing selectable Boolean logic inversion (step 2120)corresponding to each event detector.

Also as described above, and as illustrated in FIG. 20 as step 2020,multiple detection channel flags are combined into a single eventdetector flag as shown in FIG. 22 (see also FIG. 8). Initially theoutput event detector flag is set (step 2210). Beginning with the firstdetection channel for a particular event detector (step 2212), if thechannel is not enabled (step 2214), then no check is made. If thechannel is enabled and the corresponding detection channel flag is notset (step 2216), then the output event detector flag is cleared (step2218) and the combination procedure exits. If the correspondingdetection channel flag is set (step 2216), the output event detectorflag remains set, and further detection channels, if any (step 2220),are evaluated after incrementing the channel being considered (step2222). Accordingly, this combination procedure also operates as aBoolean AND operation—if any of the enabled and active detectionchannels does not have a set output flag, then no event detector flag isoutput by the procedure. It should also be observed that a Boolean ORcombination of detection channels may provide useful information incertain circumstances; a software or hardware flow chart accomplishingsuch a combination is not illustrated, but could easily be created by anindividual of ordinary skill in digital electronic design or computerprogramming.

An implantable version of a system according to the inventionadvantageously has a long-term average current consumption on the orderof 10 microamps, allowing the implanted device to operate on powerprovided by a coin cell or similarly small battery for a period of yearswithout need for replacement. It should be noted, however, that asbattery and power supply configurations vary, the long-term averagecurrent consumption of a device according to the invention may also varyand still provide satisfactory performance.

It should be observed that while the foregoing detailed description ofvarious embodiments of the present invention is set forth in somedetail, the invention is not limited to those details and an implantableneurostimulator or neurological disorder detection device made accordingto the invention can differ from the disclosed embodiments in numerousways. In particular, it will be appreciated that embodiments of thepresent invention may be employed in many different applications todetect anomalous neurological characteristics in at least one portion ofa patient's brain. It will be appreciated that the functions disclosedherein as being performed by hardware and software, respectively, may beperformed differently in an alternative embodiment. It should be furthernoted that functional distinctions are made above for purposes ofexplanation and clarity; structural distinctions in a system or methodaccording to the invention may not be drawn along the same boundaries.Hence, the appropriate scope hereof is deemed to be in accordance withthe claims as set forth below.

1. A method for detecting a neurological event by analyzing anelectrical signal from a patient's brain with an implantable device, themethod comprising the steps of: receiving a first electrical signal anda second electrical signal from a plurality of electrodes; processingthe electrical signals with a detection subsystem to obtain a firstdetection channel output and a second detection channel output;combining the first detection channel output and the second detectionchannel output to obtain an event detector output; and causing theimplantable device to perform an action in accordance with the eventdetector output.